extends "../huashengdun-3/huashengdun-3.gd"

var baseId = ""
var upText1 = "落樱神斧伤害提高40%"
var upText2 = "落樱神斧不再使积累爆伤减半"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("每{cd}秒对当前目标直线上的所有敌人造成1次[炮击*爆伤*1]的可暴击技能伤害，深海狂暴所积累的爆伤减半", "落樱神斧", "huashengdun4", 18)
var skBf = 1
func _castCdSkill(id):
	._castCdSkill(id)
	if id=="huashengdun4" and aiCha != null:
		huashengdun4()
var p4 = 1
func huashengdun4():
	utils.createSkillTextEff("终结一击", position)
	skBf = bf.att.criR + 1
	var eff2:Eff = sys.newEff("animEff", position)
	eff2.setImgs(sys.getBasePath() + "/eff/thunderFly", 9, true)
	eff2._initFlyPos(position + (aiCha.position - position).normalized() * 1000, 500)
	eff2.normalSpr.position=Vector2(0, -30)
	eff2.connect("onInCell",self,"effInCell")	
	if bf != null and upgraded != 2:
		bf.att.criR *= 0.5
	
func effInCell(cell):
	var cha = matCha(cell)
	if cha == null:
		cha = matCha(cell + Vector2(0, 1))
	if cha != null && cha.team != team:
		azurHurtChara(cha, att.atk * skBf, sys.HurtType.WEAPON, sys.AtkType.SKILL, "落樱神斧", true, p4)

func upgrade():
	.upgrade()
	if upgraded == 1:
		p4 = 1.4